<{include file='public/head'}>
<div class="layui-body">
	<div class="layui-tab layui-tab-brief" lay-filter="tab">
	  <ul class="layui-tab-title">
	    <li class="layui-this" lay-id="t1"><{$model_name}>内容</li>
	  </ul>
	  <div class="layui-tab-content">
	  	   <div class="layui-tab-item layui-show">
	  	   		<form action="<{:url('/Single/index/mcode/'.$UrlParam['mcode'].'')}>" method="get" class="layui-form">
		  	   		<div class="layui-form-item nospace">
		  	   			<div class="layui-input-inline">
					       <select name="field" class="form-control input-sm" style="width:auto;">
					       		<option value="b.name"<{if condition="$UrlParam['field'] eq 'b.name'"}> selected="selected" <{/if}>/>栏目名称</option>
                                <option value="a.title"<{if condition="$UrlParam['field'] eq 'a.title'"}> selected="selected" <{/if}>/>文章标题</option>
                                <option value="a.content" <{if condition="$UrlParam['field'] eq 'a.content'"}>selected="selected" <{/if}> />文章内容</option>
                        	</select>
					    </div>
	                     <div class="layui-input-inline">
	                     	<input type="text" name="keyword" value="<{$UrlParam['keyword']}>"  placeholder="请输入搜索关键字" class="layui-input">
	                     </div>
	                     <div class="layui-input-inline">
	                     	<button class="layui-btn" lay-submit>搜索</button>
	                     	<a class="layui-btn layui-btn-primary"  href="<{:url('/Single/index/mcode/'.$UrlParam['mcode'].'')}>">清除搜索</a>
	                     </div>
	                </div>
                </form>
	            <table class="layui-table">
	            	<thead>
	                    <tr>
	                    	<th>ID</th>
	                        <th>栏目</th>
	                        <th>标题</th>
	                        <th>时间</th>
	                        <th>状态</th>
	                        <th>访问量</th>
	                        <th>操作</th>
	                    </tr>
	                </thead>
	                <tbody>
						<{volist name="$contents" id="value"}>
	                    <tr>
	                    	<td><{$value.id}></td>
	                        <td title="<{$value.scode}>"><{$value.sort_name}></td>
	                         <td title="<{$value.title}>">
								<{:msubstr($value.title,0,15)}>
		                        <{if condition="$value.ico"}>
		                        	<span class="layui-badge layui-bg-orange">缩</span>
		                        <{/if}>
								<{if condition="$value.pics"}>
		                        	<span class="layui-badge">图</span>
		                        <{/if}>
								<{if condition="$value.outlink"}>
	                            	<span class="layui-badge layui-bg-black">链</span>
	                            <{/if}>
	                        </td>
	                        <td><{$value.date}></td>
	                        <td>
							<{if condition="$value.status"}>
		                        <a href="<{:url('/Single/mod/id/'.$value.id.'/field/status/value/0')}>"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
		                        <{else}>
		                        <a href="<{:url('/Single/mod/id/'.$value.id.'/field/status/value/1')}>"><i class='fa fa-toggle-off' title="点击开启"></i></a>
		                   <{/if}>
		                    </td>
		                    <td><{$value.visits}></td>
	                        <td>
								<{if condition="!$value.outlink"}>
									<a href="<{$value.link}>" class="layui-btn layui-btn-xs layui-btn-primary"  target="_blank">查看</a>
									<{else}>
									<input type="hidden" name="urls[<{$value.id}>]" value="<{$value.outlink}>">
									<a href="<{$value.outlink}>" class="layui-btn layui-btn-xs layui-btn-primary"  target="_blank">查看</a>
								<{/if}>
	                            	<a href="<{:url('/Single/mod/mcode/'.$value.mcode.'/id/'.$value.id.'')}><{$btnqs}>" class="layui-btn layui-btn-xs" >修改</a>
	                        </td>
	                    </tr>
	                    <{/volist}>
	                </tbody>
	            </table>
	  	   </div>
	  </div>
	 </div>

</div>
<style>.placeHolder {border:dashed 2px gray; }</style>
<script type="text/javascript">
$("#pics_box").dragsort({
	dragSelector: "dl",
	dragSelectorExclude: "input,textarea,dd",
	dragBetween: false,
	dragEnd: saveOrder,
	placeHolderTemplate: "<dl class='placeHolder'><dt></dt></dl>"
});

function saveOrder() {
	var data = $("#pics_box dl dt img").map(function() {
		return $(this).data("url");
	}).get();
	$("input[name=pics]").val(data.join(","))
};
</script>
<script type="text/javascript" src="__STATIC__/tongycjs/js/jscolor.js"></script>
<{include file='public/foot'}>